<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use think\facade\Route;

/**
 * 文章管理 相关路由
 */
Route::group('gowif', function () {

    /** 文章 */
    Route::group(function () {
        //获取文章列表
        Route::get('article/index', 'v1.gowif.GowifArticle/index')->name('index')->option(['real_name' => '获取文章列表']);
        //获取文章
        Route::get('article/get/:id', 'v1.gowif.GowifArticle/read')->name('index')->option(['real_name' => '获取文章']);
        //保存文章
        Route::post('article/save', 'v1.gowif.GowifArticle/save')->name('save')->option(['real_name' => '保存文章']);
        //修改文章
        Route::post('article/update/:id', 'v1.gowif.GowifArticle/save')->name('update')->option(['real_name' => '修改文章']);
        //删除文章
        Route::post('article/delete/:id', 'v1.gowif.GowifArticle/delete')->name('delete')->option(['real_name' => '删除文章']);
        //设置相关
        Route::post('article/set/:id', 'v1.gowif.GowifArticle/set')->name('set')->option(['real_name' => '设置相关']);
    })->option(['parent' => 'gowif', 'cate_name' => 'Gowif商学院']);

    /** 文章分类 */
    Route::group(function () {
        //获取文章分类列表
        Route::get('category/index', 'v1.gowif.GowifArticleCategory/index')->name('index')->option(['real_name' => '获取文章分类列表']);
        //保存文章分类
        Route::post('category/save', 'v1.gowif.GowifArticleCategory/save')->name('save')->option(['real_name' => '保存文章分类']);
        //修改文章分类
        Route::post('category/update/:id', 'v1.gowif.GowifArticleCategory/update')->name('update')->option(['real_name' => '修改文章分类']);
        //删除文章分类
        Route::post('category/delete/:id', 'v1.gowif.GowifArticleCategory/delete')->name('delete')->option(['real_name' => '删除文章分类']);
        //分类设置相关
        Route::post('category/set/:id', 'v1.gowif.GowifArticleCategory/set')->name('set')->option(['real_name' => '分类设置相关']);
    })->option(['parent' => 'gowif', 'cate_name' => 'Gowif商学院分类']);

})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
    \app\adminapi\middleware\AdminLogMiddleware::class
])->option(['mark' => 'gowif', 'mark_name' => 'Gowif商学院模块']);
